# 第一种方法
a = 1
while a < 10:
    b = 1
    while b <= a:
        print("{0}*{1}={2:<5}".format(b, a, a * b), end="")
        b += 1
    a += 1
    print()

print("=" * 80)

# 第二种方法
a = 9
while a >= 1:
    b = 1
    while b <= a:
        print("{0}*{1}={2:<5}".format(b, a, a * b), end="")
        b += 1
    a -= 1
    print()

print("=" * 80)

# 第三种方法
a = 1
while a <= 9:
    b = a
    c = a
    while c <= 8:
        print("{:9}".format(''), end="")
        c += 1
    while b >= 1:
        print("{0}*{1}={2:<5}".format(b, a, a * b), end="")
        b -= 1
    a += 1
    print()

print("=" * 80)

# 第四种方法
a = 9
while a >= 1:
    b = a
    c = 1
    while c <= 9 - a:
        print("{:9}".format(''), end="")
        c += 1
    while b >= 1:
        print("{0}*{1}={2:<5}".format(b, a, a * b), end="")
        b -= 1
    print()
    a -= 1

print("=" * 80)
# for in
# 第一种
print("for in 循环输出九九乘法表")
print("=" * 80)
for a in range(1, 10):
    for b in range(1, a + 1):
        print("{0}*{1}={2:<5}".format(b, a, a * b), end="")
    print()

print("=" * 80)

# 第二种
for a in range(1, 10).__reversed__():
    for b in range(1, a + 1):
        print("{0}*{1}={2:<5}".format(b, a, a * b), end="")
    print()

print("=" * 80)

# 第三种
for a in range(1, 10):
    for c in range(a, 9):
        print("{:9}".format(''), end='')
    for b in range(1, a + 1).__reversed__():
        print("{0}*{1}={2:<5}".format(b, a, a * b), end="")
    print()

print("=" * 80)
# 第四种
for a in range(1, 10).__reversed__():
    for c in range(a, 9):
        print("{:9}".format(''), end='')
    for b in range(1, a + 1).__reversed__():
        print("{0}*{1}={2:<5}".format(b, a, a * b), end="")
    print()
